import jieba.posseg as pseg


with open('../data/官渡之战.txt','r',encoding='utf-8') as f:
    content = f.read()
    words = pseg.cut(content)
    for word, flag in words:
        print('%s, %s' % (word, flag))


print("----------------------------------------")
print("上述名词短语标记为:Ng,n,nr,ns,nt,nz")
print("上述动词短语标记为:v,vd,vn")
print("若碰到特殊术语的语聊，需要另外训练后方可使用")